https://www.nowcoder.com/practice/f2fbd8f61c564ca0b5feaa63ab42dae5?tpId=182&&tqId=34867&rp=1&ru=/ta/exam-all&qru=/ta/exam-all/question-ranking


#include <stdio.h>
int main() {
    int n;
    scanf("%d", &n);
    char arr[n][100];
    for (int i = 0; i < n; i++)
    {
        int a = 0, A = 0, u = 0;
        scanf("%s", arr[i]);
        if ('0' <= arr[i][0] && arr[i][0] <= '9')
        {
            printf("NO\n");
            continue;
        }
        int j = 0;
        int count = 0;
        while (arr[i][j] != '\0')
        {
            count++;

            if ('A' <= arr[i][j] && arr[i][j] <= 'Z') {
                A++;

            }
            else  if ('a' <= arr[i][j] && arr[i][j] <= 'z') {
                a++;


            }
            else if ('0' <= arr[i][j] && arr[i][j] <= '9') {
                u++;
            }
            else {
                printf("NO\n");
                j++;
                continue;
            }
            j++;


        }

        if ((a == 0 && A == 0) || (A == 0 && u == 0) || (a == 0 && u == 0)) {
            printf("NO\n");
            continue;
        }

        if (count < 8)
        {
            printf("NO\n");
            continue;
        }

        printf("YES\n");


    }


    return 0;
}